package marking.liu.mapper;

import marking.liu.pojo.domain.GainerDataDomain;
import marking.liu.pojo.domain.Stock4MinuteDomain;
import marking.liu.pojo.entity.StockRtInfo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
* @author marking liu
* @description 针对表【stock_rt_info(个股详情信息表)】的数据库操作Mapper
* @createDate 2024-07-18 23:42:52
* @Entity marking.liu.pojo.entity.StockRtInfo
*/
public interface StockRtInfoMapper {

    int deleteByPrimaryKey(Long id);

    int insert(StockRtInfo record);

    int insertSelective(StockRtInfo record);

    StockRtInfo selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StockRtInfo record);

    int updateByPrimaryKey(StockRtInfo record);

    /**
     * 查询最新股票交易时间点下沪深的行情数据
     * @return
     */
    List<GainerDataDomain> getNewestStockInfo(GainerDataDomain gainerDataDomain);

    /**
     * 获取涨幅榜排行前四的数据
     * @param date
     * @return
     */
    List<GainerDataDomain> getTop4StockInfo(Date date);

    /**
     * 查询涨幅榜统计
     * @param openTime
     * @param currTime
     * @param i
     * @return
     */
    List<Map> getStockUpdownCount(
            @Param("openTime") Date openTime,
            @Param("currTime") Date currTime,
            @Param("flag") int i);

    /**
     * 根据时间范围查询指定股票的交易流水
     * @param date
     * @param date1
     * @param code
     * @return
     */
    List<Stock4MinuteDomain> getStockInfoByCodeAndDate(@Param("openDate") Date date, @Param("nowDate") Date date1,@Param("code") String code);

    /**
     * 批量插入功能
     * @param stockRtInfoList
     */
    int insertBatch(@Param("list") List<StockRtInfo> stockRtInfoList);
}
